package com.example.chamberlainserver.Service;

import com.example.chamberlainserver.Entry.ScheduleAssignment;
import com.example.chamberlainserver.dto.PageResult;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
 * 排班分配服务接口
 */
public interface ScheduleAssignmentService {
    /**
     * 添加排班分配
     */
    boolean addScheduleAssignment(ScheduleAssignment scheduleAssignment);
    
    /**
     * 批量添加排班分配
     */
    boolean batchAddScheduleAssignment(List<ScheduleAssignment> scheduleAssignmentList);
    
    /**
     * 根据ID查询排班分配
     */
    ScheduleAssignment getScheduleAssignmentById(String id);
    
    /**
     * 根据用户ID查询排班分配
     */
    List<ScheduleAssignment> getScheduleAssignmentsByUserId(Integer userId);
    
    /**
     * 根据日期范围查询排班分配
     */
    List<ScheduleAssignment> getScheduleAssignmentsByDateRange(LocalDate startDate, LocalDate endDate);
    
    /**
     * 根据班次ID查询排班分配
     */
    List<ScheduleAssignment> getScheduleAssignmentsByShiftId(String shiftId);
    
    /**
     * 根据用户ID和日期查询排班分配
     */
    List<ScheduleAssignment> getScheduleAssignmentsByUserAndDate(Integer userId, LocalDate scheduleDate);
    
    /**
     * 更新排班分配
     */
    boolean updateScheduleAssignment(ScheduleAssignment scheduleAssignment);
    
    /**
     * 删除排班分配
     */
    boolean deleteScheduleAssignment(String id);
    
    /**
     * 更新排班分配状态
     */
    boolean updateScheduleAssignmentStatus(String id, String status);
    
    /**
     * 分页查询排班分配列表
     */
    PageResult<ScheduleAssignment> getPagedScheduleAssignmentList(Map<String, Object> params);
    
    /**
     * 智能排班生成
     */
    List<ScheduleAssignment> generateSmartSchedule(LocalDate startDate, LocalDate endDate, Integer assignedBy);
    
    /**
     * 统计用户在指定时间范围内的排班次数
     */
    Integer countUserAssignmentsInDateRange(Integer userId, LocalDate startDate, LocalDate endDate);
    
    /**
     * 检查排班冲突
     */
    boolean checkScheduleConflict(ScheduleAssignment scheduleAssignment);
}